<html>
<head>
<meta charset="UTF-8">
<title>엘리먼트 객체</title>
<script type="text/javascript">
	function countChildren(element) {
		var children = document.getElementById('container').childNodes;
		alert(children.length);
	}
</script>
</head>
<body>
	<button onclick="countChildren();">하위 엘리먼트는 몇 개?</button>
	<div id="container" style="border: 5px solid black; height: 100px;">
		<span>SPAN 엘리먼트</span>
		<p>P 엘리먼트</p>
	</div>
</body>
</html>
